import request from '@/router/axios';
import config from '@/config/website'

//列表
export const testList = (current, size, equipment) => {
    return request({
        url: '/api/blade-sale/hg_sale/customercredit/page',
        method: 'get',
        params: {
            current,
            size,
            ...equipment
        }
    })
}


//新建
export const testAdd = (data) => {
    return request({
        url: '/api/blade-sale/hg_sale/customercredit/save',
        method: 'post',
        data
    })
}
//修改
export const testUpdate = (data) => {
    return request({
        url: '/api/blade-sale/hg_sale/customercredit/update',
        method: 'post',
        data
    })
}
//查看
export const testView = (id) => {
    return request({
        url: '/api/blade-sale/hg_sale/customercredit/detail',
        method: 'get',
        params: {
            id
        }
    })
}

//删除
export const testDel = (ids) => {
    return request({
        url: '/api/blade-sale/hg_sale/customercredit/remove',
        method: 'post',
        params: {
            ids
        }
    })
}
//查询可用的信用权重
export const getTestCredit = () => {
    return request({
        url: '/api/blade-sale/hg_sale/customercredit/getSaleAppraiseTarget',
        method: 'get',
    })
}
//获取年销售额
export const getYearSale = (customerId,year) => {
    return request({
        url: '/api/blade-sale/hg_sale/customercredit/getSaleAmount',
        method: 'get',
        params:{
            customerId,
            year 
        }
    })
}